package com.anXin.article.common.exHandler;

import com.anXin.model.common.dtos.article.ServiceException;
import com.anXin.model.common.dtos.ResponseResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@Slf4j
@RestControllerAdvice
public class GlobalExceptionHandler {


    @ExceptionHandler
    public ResponseResult handleServiceException(ServiceException e){
        log.info("处理Service异常");
        return ResponseResult.fail(e);
    }
}
